<template>
	<div>
		<el-row :gutter="10">
			<el-col :span="4"><el-input v-model="platenumber" placeholder="请输入需要查询的车牌"></el-input></el-col>
			<el-col :span="4" style="text-align: left;"><el-button type="primary"
					@click="mygetparkingrecord(1, 15)">确定</el-button></el-col>
		</el-row>
		<el-table :data="tabledata">
			<el-table-column label="车牌号" prop="plateNum"></el-table-column>
			<el-table-column label="进场时间" prop="inTime"></el-table-column>
			<el-table-column label="出场时间" prop="outTime"></el-table-column>
			<el-table-column label="停车状态" prop="statusLabel"></el-table-column>
			<el-table-column label="停车费用" prop="parkingFee"></el-table-column>
		</el-table>
		<el-pagination layout="prev,pager,next" :page-size="15" :total="totalsize"
			@current-change="changepage"></el-pagination>
	</div>
</template>
   
<script>
import { getparkingrecord } from '../api.js'
export default {

	data() {
		return {
			tabledata: [],
			totalsize: 0,
			platenumber: ''
		}
	},

	mounted() {
		this.mygetparkingrecord(1, 15);
	},


	methods: {

		changepage(page) {
			this.mygetparkingrecord(page, 15);
		},

		mygetparkingrecord(page, size) {

			let params = {
				page: page,
				size: size,
				plateNum: this.platenumber
			}
			getparkingrecord(params).then((res) => {

				let result = res.data;
				console.log(result);
				this.tabledata = result.data;
				this.totalsize = result.totalSize;
			})
		}
	},
}
</script>
   
<style></style>